﻿package net.area80.serverside.activity.adapter
{
	import net.area80.serverside.activity.core.HTTPActivity;
	import net.area80.serverside.errors.AdapterErrorCodes;

	
	/**
	* AdapterHTTPActivity
	* @author Wissarut Pimanmassuriya
	*/
	public class AdapterHTTPActivity extends HTTPActivity
	{
		/**
		 * Abstract class prototype 
		 * @param	parser
		 */
		public function AdapterHTTPActivity (parser:Function = null):void {
			this.parser = parser;
			this.errorCodes = new AdapterErrorCodes();
		}

		protected override function processData (data:*):void {
			var dataXML:XML = XML(data);
			if (dataXML.@sResult == 1) {
				onSeccess(dataXML);
			} else {
				onError(dataXML.@sReason);
			}
		}
		
	}
	
}